﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WcfServer.Classes.Utility;


namespace Server
{
    class ServerUI
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Generate a new server key (y/n)?");
            if(Console.Read() == 'y')
            {
                KeyHandler.deleteKeyFromContainer("Server");
                FileStream fs = new FileStream(@"server_public.xml", FileMode.OpenOrCreate, FileAccess.ReadWrite);
                StreamWriter sw = new StreamWriter(fs);
                sw.WriteLine(KeyHandler.getKey_XML("Server", false));
                sw.Close();
                fs.Close();
            }
        }
    }
}
